\hypertarget{class_tcp_server}{\section{Tcp\+Server类 参考}
\label{class_tcp_server}\index{Tcp\+Server@{Tcp\+Server}}
}


Tcp\+Server类  




{\ttfamily \#include $<$Socket.\+h$>$}

类 Tcp\+Server 继承关系图\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{class_tcp_server}
\end{center}
\end{figure}
\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
virtual sint32 \hyperlink{class_tcp_server_a734911e336ac9231c6acbbf2494e6ba8}{recv\+Data} (char $\ast$buf, sint32 len)
\begin{DoxyCompactList}\small\item\em 服务器接收数据方法 \end{DoxyCompactList}\item 
virtual sint32 \hyperlink{class_tcp_server_a3b42dcd08441b83b3474a1647df9211e}{send\+Data} (const char $\ast$buf, sint32 len)
\begin{DoxyCompactList}\small\item\em 服务器发送数据方法 \end{DoxyCompactList}\item 
\hypertarget{class_tcp_server_a2208ee6ddd8d61a1efd4f81718d900b4}{virtual void {\bfseries service\+Loop} ()=0}\label{class_tcp_server_a2208ee6ddd8d61a1efd4f81718d900b4}

\end{DoxyCompactItemize}


\subsection{详细描述}
Tcp\+Server类 

\subsection{成员函数说明}
\hypertarget{class_tcp_server_a734911e336ac9231c6acbbf2494e6ba8}{\index{Tcp\+Server@{Tcp\+Server}!recv\+Data@{recv\+Data}}
\index{recv\+Data@{recv\+Data}!Tcp\+Server@{Tcp\+Server}}
\subsubsection[{recv\+Data}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Tcp\+Server\+::recv\+Data (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{buf, }
\item[{sint32}]{len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_tcp_server_a734911e336ac9231c6acbbf2494e6ba8}


服务器接收数据方法 


\begin{DoxyParams}{参数}
{\em buf} & 接收缓存 \\
\hline
{\em len} & 缓存的大小 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
返回值ret大于0表示接收到ret个数据,等于0表示断开连接,小于0表示接收失败 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
默认为\+Socket的接收方法,用户可覆盖以定制自己的接收方法 
\end{DoxyNote}


重载 \hyperlink{class_udp_server_ad6a00822c7b318204d96057e5913309e}{Udp\+Server} .

\hypertarget{class_tcp_server_a3b42dcd08441b83b3474a1647df9211e}{\index{Tcp\+Server@{Tcp\+Server}!send\+Data@{send\+Data}}
\index{send\+Data@{send\+Data}!Tcp\+Server@{Tcp\+Server}}
\subsubsection[{send\+Data}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Tcp\+Server\+::send\+Data (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{buf, }
\item[{sint32}]{len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_tcp_server_a3b42dcd08441b83b3474a1647df9211e}


服务器发送数据方法 


\begin{DoxyParams}{参数}
{\em buf} & 发送数据 \\
\hline
{\em len} & 数据长度 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回发送的数据长度,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
默认为\+Socket的发送方法,用户可覆盖以定制自己的发送方法 
\end{DoxyNote}


重载 \hyperlink{class_udp_server_ab4f6ac2151bbbfd421cbe11df2f4d63e}{Udp\+Server} .



该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_socket_8h}{Socket.\+h}\item 
libemb/src/Socket.\+cpp\end{DoxyCompactItemize}
